Declare @Id bigint
Declare @getId Cursor

set @getId = Cursor for
select Id from ModemString

open @getId
fetch next
from @getId into @Id

while @@FETCH_STATUS = 0
begin
print @Id
fetch next 
from @getId into @Id
end

close @getId
deallocate @getId